package liurong.driver.list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

//import org.junit.jupiter.api.Test;

public class ListTest {
	/*
	 * @Test public void fun1() { List<Long> list1 = new ArrayList<Long>(); Long
	 * long1 = 95974l; list1.add(long1);
	 * 
	 * List<Long> list2 = new ArrayList<Long>(); long long2 = 95974l;
	 * list2.add(long2);
	 * 
	 * list1.retainAll(list2); System.out.println(list1); System.out.println(list2);
	 * }
	 */

//	public static void main(String[] args) {
//		List<Integer> list1 = new ArrayList<Integer>();
//		list1.add(1);
//		list1.add(2);
//		list1.add(3);
//		list1.add(4);
//		list1.add(5);
//
//		System.out.println(list1);
//		Iterator<Integer> iterator = list1.iterator();
//		while (iterator.hasNext()) {
//			Integer next = iterator.next();
//			if (next == 1 || next == 3) {
//				iterator.remove();
//			}
//			System.out.println(next);
//		}
//
//		System.out.println(list1);
//	}

	public static void main(String[] args) {
		List<Student> students = new ArrayList<>();
		Student student = new Student();
		student.setAge(20);
		for (int i = 0; i < 3; i++) {
			student.setUsername("liu" + i);
			student.setPassword(i + "");

			students.add(student);
		}

		System.out.println(students);
	}

	static class Student {
		private String username;
		private String password;
		private int age;

		public String getUsername() {
			return username;
		}

		public void setUsername(String username) {
			this.username = username;
		}

		public String getPassword() {
			return password;
		}

		public void setPassword(String password) {
			this.password = password;
		}

		public int getAge() {
			return age;
		}

		public void setAge(int age) {
			this.age = age;
		}

		@Override
		public String toString() {
			return "Student [username=" + username + ", password=" + password + ", age=" + age + "]";
		}

	}
}
